package com.ruoyi.web.controller.common;

import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version :
 * @program: easyBuy
 * @description: app版本管理
 * @author: 周爱鸿
 * @create: 2020-11-11 15:21
 **/
@RestController
@RequestMapping("appversion")
public class AppVersionController {
	@Value("${app.version:2.0}")
	private String appversion;
	@Value("${app.url}")
	private String url;
	@GetMapping("/getVersion")
	private AjaxResult appVersion(String version){
		if (!appversion.equals(version)){
			return AjaxResult.error("检测到新版本,需要更新",url);
		}
		return AjaxResult.success("已经是最新版了");
	}
}
